package be.ibiiztera.md.pmatrix.pushmatrix;


public class BezierCubique2D implements Representable, TRIConteneur, Generator {
	private String id;
	private final int ordre = 3;
	/***
	 * 11 12 13 14 0123 21 22 23 24 4567 31 32 33 34 8901 41 42 43 44 2345
	 */
	private Point3D[][] controle;

	private TRIObject plane;

	public BezierCubique2D(Point3D[][] controle) {
		this.controle = controle;


	}

	public BezierCubique2D() {
	}

	public int getOrdre() {
		return ordre;
	}

	public Point3D[][] getControle() {
		return controle;
	}

	public void setControle(int l, int c, Point3D p) {
		controle[l][c] = p;
	}

	public Point3D calculerPoint3D(double tx, double ty) {
		return null;
	}

	public String getId() {
		return id;
	}

    @Override
	public void setId(String id) {
		this.id = ID.GEN(this);
	}

	@Override
	public String id() {
		return id;
	}

    @Override
	public String toString() {
		String s = "bezier2d ( ";
		for (int l = 0; l < 4; l++)
			for (int c = 0; c < 4; c++)
				s += controle[l][c].toString() + " ";
		return s + " )\n";
	}

	@Override
	public TRIObject generate() {
		return TRIGeneratorUtil.P32DTriQuad(controle, 4, 4);
	}

	@Override
	public Iterable<TRI> iterable() {
		return plane.getTriangles();
	}

	@Override
	public Representable getObj() {
		return plane;
	}

    public Representable place(MODObjet aThis) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
